package cn.net.wanji.entity.deviceStatus;

import cn.net.wanji.entity.MyDeviceInfo;
import lombok.Data;

/**
 * @author guodejun
 * @createTime 2022/11/18 16:42
 * @description
 */
@Data
public class LaserHeartbeat {
    String deviceId;
    String stateTime;
    String brand;
    String deviceType;
    String deviceSn;
    String connectStatus;
    String workStatus;
    String statusCode;
    String statusMsg;

    public MyDeviceInfo getDevBaseInfo(String siteCode, String deviceTypeCode) {
        MyDeviceInfo devBaseInfo = new MyDeviceInfo();
        devBaseInfo.setSiteCode(siteCode);
        devBaseInfo.setDeviceTypeCode(deviceTypeCode);
        devBaseInfo.setDeviceCode(deviceId);
        if (stateTime != null) {
            devBaseInfo.setStateTime(stateTime.replace("T", " "));
        }
        devBaseInfo.setBrand(brand);
        devBaseInfo.setDeviceType(deviceType);
        devBaseInfo.setSn(deviceSn);
        devBaseInfo.setConnectStatus(connectStatus);
        devBaseInfo.setWorkStatus(workStatus);
        devBaseInfo.setStatusCode(statusCode);
        devBaseInfo.setStatusMsg(statusMsg);
        return devBaseInfo;
    }
}
